package com.jon.experiment3.AutoPull;

import com.jon.experiment3.Service.covidTrackService;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * author 陈伯瑞
 * date 2020/5/8 0008 14:14
 * version 1.0
 **/
@Configuration
public class InitializingBean {
    /**
     *每次启动自动获取一次数据
     */

    @Bean
    public CommandLineRunner commandLineRunner(covidTrackService covidTrackService){

        return args ->{
            System.out.println("CommandLineRunner!!!!!!!!!!");
            covidTrackService.getLastCovidData();
        };

    }

}
